package models;

import play.mvc.*;

import akka.actor.UntypedActor;


/**
 * Text text is an Actor.
 */
public class Model extends UntypedActor {
    WebSocket.In<String> in;
    WebSocket.Out<String> out;

    public Model(WebSocket.In<String> in, WebSocket.Out<String> out) {
        this.in = in;
        this.out = out;
    }

    @Override
    public void onReceive(Object message) {
        if (message.equals("Tick")) {
            out.write(DB.getText());     
        } else {
            unhandled(message);
        }
    }
}
